<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/react/umd/react.development.js"></script>
    <script src="../node_modules/react-dom/umd/react-dom.development.js"></script>
    <script src="../node_modules/babel-standalone/babel.js"></script>
    <script src="../node_modules/prop-types/prop-types.js"></script>
</head>

<body>
    <div id="root"></div>

    <script type="text/babel">
        let bros = ["李逵", "王英", "小霸王周通"];

        function Container() {
            return (
                <div>
                    <h3>Container</h3>
                    <DataLister list={bros}></DataLister>
                </div>
            )
        }

        class DataLister extends React.Component {
            // constructor(props){
            //     super(props)
            // }

            render() {
                return (
                    <div>
                        <h4>DataLister</h4>
                        {/* <div>{this.props.list}</div> */}
                        <ul>{
                            this.props.list.map(
                                (item, index) => <li key={item + index}>{item}</li>
                            )
                        }</ul>
                    </div>
                )
            }
        }

        ReactDOM.render(<Container />, document.querySelector("#root"))
    </script>
</body>

</html>